package com.example.learningspringboot;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
//扫描到Mapper接口类
@MapperScan("com.example.learningspringboot.mybatis.mapper")
//开始事务
@EnableTransactionManagement
public class LearningSpringBootApplication {
//public class LearningSpringBootApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(LearningSpringBootApplication.class, args);
    }

//    这里是为了测试某个bean是否在IOC容器中注册成功
//    @Autowired(required = false)
//    private JavaMailSender javaMailSender;
//    @Override
//    public void run(String... args) throws Exception {
//        if (javaMailSender != null) {
//            System.out.println("JavaMailSender bean 创建成功!");
//        } else {
//            System.out.println("JavaMailSender bean 创建失败!");
//        }
//    }
}
